using LightCAD.Runtime;
using LightCAD.UI;
using System;
using System.Windows.Forms;

namespace LightCAD.WinForm
{
    public partial class MainUIWindow : FormBase, IMainWindow
    {
        public MainUIWindow()
        {
            InitializeComponent();
            this.Deactivate += MainUIWindow_Deactivate;
            this.Activated += MainUIWindow_Activated;
        }
        public MainUIWindow(bool hasDocument):this()
        {
            this.mainUI.hasDocument = hasDocument;
        }
        public Type WinType => this.GetType();

        public bool IsActive => this.mainUI.IsActive;

        private void MainUIWindow_Activated(object? sender, EventArgs e)
        {
            this.mainUI.IsActive = true;
           
        }

        private void MainUIWindow_Deactivate(object? sender, EventArgs e)
        {
            this.mainUI.IsActive = false;
        }

        private void mainUI_Load(object sender, EventArgs e)
        {

        }
    }
}